package android.tusnotas.beans;

import android.os.Parcel;
import android.os.Parcelable;

public class GroupMessage implements Parcelable{
	private Integer id;
	private String user;
	private String date;
	private String text;
	
	public GroupMessage(){}

	public GroupMessage(Integer id, String user, String date, String text) {
		super();
		this.id = id;
		this.user = user;
		this.date = date;
		this.text = text;
	}

	public GroupMessage(String user, String date, String text) {
		super();
		this.user = user;
		this.date = date;
		this.text = text;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public String getText() {
		return text;
	}

	public void setText(String text) {
		this.text = text;
	}

	@Override
	public int describeContents() {
		return hashCode();
	}

	@Override
	public void writeToParcel(Parcel dest, int flags) {
		//dest.writeInt(this.id);
		dest.writeInt(0);
		dest.writeString(this.user);
		dest.writeString(this.date);
		dest.writeString(this.text);
	}
	
	private GroupMessage(Parcel in){
		this.id=in.readInt();
		this.user=in.readString();
		this.date=in.readString();
		this.text=in.readString();
	}
	
	public static final Parcelable.Creator<GroupMessage> CREATOR = new Parcelable.Creator<GroupMessage>() {
		public GroupMessage createFromParcel(Parcel in) {
			return new GroupMessage(in);
		}

		public GroupMessage[] newArray(int size) {
			return new GroupMessage[size];
		}
	};
	
	
}
